/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tabox.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author rendy
 */
public class Server extends Thread{
    @Override
    public void run(){
        try {
            ServerSocket servsock = new ServerSocket(6666);
            while (true) {
                System.out.println("Waiting...");
                Handler handler = new Handler(servsock.accept());
                handler.start();
            }
        } catch (IOException ex) {
            Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public static void main(String[] args){
        Server server = new Server();
        server.start();
    }
}
